package model;

import java.util.ArrayList;

public class Map{
	private ArrayList<Wall> walls;

	// constructor
	public Map(){
		 walls = new ArrayList<Wall>();
	}
	
	// for graphics only
	public ArrayList<Wall> getWalls(){
			return walls;
	}
	
	// adds a new wall to the level
	public void addWall(int startX,int startY,int endX,int endY){
		walls.add(new Wall(startX,startY,endX,endY));
	}
	
	// returns true if the walls won't interfere with the movment
	public boolean canMove(int startX,int startY,int endX,int endY,boolean movesHorizontally){
		for(Wall wall: walls){
			if (wall.isTriyingToPassThrough(startX,startY,endX,endY,movesHorizontally))
				return false;
		}
		return true;
	}	
}
